package com.mb;

import java.io.Serializable;
import java.util.List;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

import com.dao.SistemaDAO;
import com.model.Sistema;

@SessionScoped
@ManagedBean(name = "sistemaMB")
public class SistemaMB implements Serializable {
	public static final String INJECTION_NAME = "#{sistemaMB}";
	private static final long serialVersionUID = 1L;

	private SistemaDAO sistemaDAO = new SistemaDAO();

	private List<Sistema> sistemas;

	private Sistema selectedSistema;

	public SistemaMB() {
		sistemaDAO.beginTransaction();
		sistemas = sistemaDAO.getAll(Sistema.GET_ALL);
	}

	public List<Sistema> getSistemas() {
		return sistemas;
	}

	public Sistema getSelectedSistema() {
		return selectedSistema;
	}

	public void setSelectedSistema(Sistema selectedSistema) {
		this.selectedSistema = selectedSistema;
	}
}